package com.wc.AlgoOJ.DS0003;

import java.io.*;

/**
 * @Author congege
 * @Description 出栈序列判断
 * http://43.138.190.70:8888/p/DS0003
 * @Date Created in 2023/12/14-17:35
 */
public class Main {
    static StreamTokenizer in = new StreamTokenizer(new BufferedReader(new InputStreamReader(System.in)));
    static PrintWriter out = new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out)));

    public static void main(String[] args) {
        int n = nextInt();
        int[] array = new int[n + 1];
        for (int i = 1; i <= n; i++) {
            array[i] = nextInt();
        }
        int idx = 1;
        for (int i = 1; i <= n; i++) {
            out.println("push " + i);
            while (idx <= n && array[idx] <= i) {
                idx++;
                out.println("pop");
            }
        }

        out.flush();
        out.close();
    }

    public static int nextInt() {
        try {
            in.nextToken();
        } catch (IOException e) {
            e.printStackTrace();
        }
        return (int) in.nval;
    }
}
